{% load cache i18n package_tags page_metadata_tags profile_tags static tailwind_cli waffle_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}" {% block angular_header %}ng-app{% endblock %}>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        {% block metadata %}{% page_metadata %}{% endblock %}
        {% block angularjs %}
            <script src="{% static 'angular/angular.min.js' %}"></script>
            <script src="{% static 'angular/controllers.js' %}?123"></script>
        {% endblock angularjs %}
        <link rel="stylesheet" href="{{ STATIC_URL }}bower_components/bootstrap/dist/css/bootstrap.min.css" type="text/css" />
        <link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap-glyphicons.css" type="text/css" />
        <link rel="stylesheet" href="{{ STATIC_URL }}components/audreyr-rotatingnav/dist/jquery.rotatingnav.min.css" type="text/css" />
        <link rel="stylesheet" href="{{ STATIC_URL }}components/audreyr-topbar/dist/jquery.topbar.min.css" type="text/css" />
        <link rel="stylesheet" href="{{ STATIC_URL }}css/oc.css" type="text/css" />
        <link rel="search" type="application/opensearchdescription+xml" href="{% url 'opensearch-description' %}" title="Django Packages">
        {% tailwind_css %}
        <link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.png" />
        {% block extra_head %}{% endblock %}
    </head>
    <body
        class="flex flex-col min-h-screen"
        ng-controller="SearchCtrl"
        ng-init="init_search('{{ request.GET.q|escapejs }}', '{% url 'apiv4:searchv2-list' %}', {{ MAX_WEIGHT }}, {{ TEST_MODE }})"
    >

        {% for message in messages %}
            <div class="topbar topbar-default{% if message.tags %} {{ message.tags }}{% endif %}" id="message_{{ forloop.counter }}">
                <div class="container">
                    {{ message }}
                    <button type="button" class="close" data-dismiss="message">&times;</button>
                </div>
            </div>
        {% endfor %}

        <!-- Migration Notice Banner -->
        <div class="alert alert-warning" role="alert" style="margin-bottom: 0; border-radius: 0; text-align: center; background-color: #fff3cd; border-color: #ffeaa7; color: #856404;">
            <div class="container">
                <strong>{% translate "Scheduled Maintenance:" %}</strong>
                {% translate "We migrated to a new server. Please leave feedback on this issue if you experience any issues." %}
                <a href="https://github.com/djangopackages/djangopackages/issues/1445" target="_blank" rel="noopener noreferrer" style="color: #856404; text-decoration: underline;">
                    {% translate "Learn more" %}
                </a>
            </div>
        </div>
        <!-- End Migration Notice Banner -->

        <div class="header">
            <div class="container">
                <!-- Start of navbar -->
                <div class="navbar">

                    <!-- Logo and title -->
                    <a class="flex items-center navbar-brand" href="{% url 'home' %}">
                        <img src="{{ STATIC_URL }}img/logo_squares.png" />
                        <h1>{{ SITE_TITLE }}</h1>
                    </a>

                    <!-- Main nav -->
                    <ul class="nav navbar-nav navbar-right hidden-xs">
                        <form action="{% url 'search' %}" class="navbar-form pull-left hidden-xs">
                            <div class="input-group">
                                <input type="text" name="q" class="col-12 form-control" style="width: 240px;" id="search-2"
                                       ng-model="model.q" ng-keyup="search(model, '{% url 'apiv4:searchv2-list' %}')"
                                       placeholder="Search (Press “/” to focus)" autocomplete="off">
                                <span class="input-group-addon"><span class="glyphicon glyphicon-search text-success" aria-hidden="true"></span></span>
                            </div>
                        </form>
                        {% if request.user.is_authenticated %}
                            {% if profile.github_account %}
                                <li><a href="{% url 'profile_detail' profile.github_account %}" class="btn">{{ profile.github_account }}</a>
                                </li>
                            {% endif %}
                            {% if request.user.is_staff %}
                                <li><a href="{% url 'admin:index' %}" class="btn">{% translate "Admin" %}</a></li>
                            {% endif %}
                            <li><a href="{% url 'logout' %}" class="btn">{% translate "Log out" %}</a></li>
                        {% else %}
                            <li>
                                <a href="{% url 'social:begin' 'github' %}{% if current_path %}?next={{ current_path }}{% endif %}" class="btn">{% translate "Log In" %}</a>
                            </li>
                        {% endif %}

                    </ul>

                    <!-- Search form -->


                </div>
                <!-- End of navbar -->
            </div>
        </div>

        <div id="myrotatingnav" class="rotatingnav slide">
            <div class="rotatingnav-inner">
                {% for grid_chunk in grid_headers %}
                    <div class="item">
                        {% for tab in grid_chunk %}
                            {% if tab %}
                                <a href="{% url 'grid' tab.slug %}" title="{{ tab.description }}">{{ tab.title|truncatechars:"17" }}</a><br />
                            {% endif %}
                            {% if forloop.parentloop.last and forloop.last %}
                                <a class="gridnav-name" href="{% url 'grids' %}">{% translate "&raquo; more grids..." %}</a>
                            {% endif %}
                        {% endfor %}
                    </div>
                {% endfor %}

                <a class="left rotatingnav-control">
                    <span class="icon-prev"></span>
                </a>
                <a class="right rotatingnav-control">
                    <span class="icon-next"></span>
                </a>

            </div>
        </div>
        {% block pre_body %}{% endblock %}
        {% block breadcrumb %}{% endblock %}
        <div class="container flex-grow" ng-hide="items">
            {% block body %}
            {% endblock body %}
        </div>
        <div class="container" ng-show="items">
            <div class="row">
                <div class="col-12 table-responsive">
                    <table class="table">
                        <thead>
                            <tr>
                                <th>{% translate "Search Weight" %}</th>
                                <th>{% translate "Package" %}</th>
                                <th>{% translate "Description" %}</th>
                                <th>{% translate "Last PyPI release" %}</th>
                                {% flag "enabled_packages_score_values" %}
                                    <th
                                        {% if TEST_MODE %}data-testid="search-results-score-header"{% endif %}
                                        scope="col"
                                        data-toggle="tooltip"
                                        data-placement="bottom"
                                        container="body"
                                        aria-label="{% translate 'Score' %}"
                                        title="{% translate 'Scores (0-100) are based on Repository stars, with deductions for inactivity (-10% every 3 months) and lack of Python 3 support (-30%).' %}"
                                    >
                                        {% translate "Score" %}
                                        <span class="glyphicon glyphicon-stats"></span>
                                    </th>
                                {% endflag %}
                                <th
                                    scope="col"
                                    data-toggle="tooltip"
                                    data-placement="top"
                                    aria-label="{% translate 'Number of Stars' %}"
                                    title="{% translate 'Number of stars on the Repository.' %}"
                                >
                                    {% translate "Stars" %}
                                    <span class="glyphicon glyphicon-star"></span>
                                </th>
                                <th
                                    scope="col"
                                    data-toggle="tooltip"
                                    data-placement="top"
                                    aria-label="{% translate 'Number of Forks' %}"
                                    title="{% translate 'Number of forks on the Repository.' %}"
                                >
                                    {% translate "Forks" %}
                                    <span class="glyphicon glyphicon-random"></span>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            {% verbatim %}
                                <tr ng-repeat="item in items">
                                    <td>{{ item.weight / max_weight * 100 | number:0 }}%</td>
                                    <td>
                                        <a ng-href="{{ item.absolute_url }}">{{ item.title }}</a>
                                    </td>
                                    <td>
                                        <strong ng-if="item.item_type=='grid'">Grid:</strong>
                                        {{ item.description }}
                                    </td>

                                    <td ng-if="item.item_type=='package'">
                                        {{ item.last_released | date: 'mediumDate' }}
                                    </td>
                                    <td ng-if="item.item_type=='grid'">
                                        N/A
                                    </td>
                                    <td
                                        data-testId="{{ TEST_MODE ? 'search-results-' + item.slug + '-score-cell' : null }}"
                                        ng-if="item.item_type=='package' && waffle_flag_is_active('enabled_packages_score_values')"
                                    >
                                        {{ item.score }}
                                    </td>
                                    <td
                                        data-testId="{{ TEST_MODE ? 'search-results-' + item.slug + '-score-cell' : null }}"
                                        ng-if="item.item_type=='grid' && waffle_flag_is_active('enabled_packages_score_values')"
                                    >
                                        N/A
                                    </td>
                                    <td ng-if="item.item_type=='package'">{{ item.repo_watchers }}</td>
                                    <td ng-if="item.item_type=='grid'">
                                        N/A
                                    </td>
                                    <td ng-if="item.item_type=='package'">
                                        {{ item.repo_forks }}
                                    </td>
                                    <td ng-if="item.item_type=='grid'">
                                        N/A
                                    </td>
                                </tr>
                            {% endverbatim %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="container pre-pre-footer">
            <div class="row">
                <div class="text-center col-sm-12">

                    Projects listed on Django Packages are third-party packages. They are not vetted nor endorsed by the Django Software Foundation. Use them at your own risk.

                </div>

            </div>
        </div>
        <div class="container pre-footer">
            <div class="row">
                <div class="text-center col-sm-12">

                    <a href="https://github.com/djangopackages/djangopackages">Repo</a>

                    <a href="{% url 'faq' %}">{% translate "FAQ" %}</a>

                    <a href="{% url 'terms' %}">{% translate "Terms" %}</a>

                    <a href="https://docs.djangopackages.org/en/latest/contributing">{% translate "Contribute" %}</a>

                    <a href="https://docs.djangopackages.org/en/latest/apiv3_docs">{% translate "API" %}</a>

                    <a href="{% url 'syndication' %}">{% translate "RSS / Atom" %}</a>

                    <a href="{% url 'post_list' %}">{% translate "Changelog" %}</a>

                    <a href="{% url 'funding' %}">{% translate "Funding" %}</a>

                    <a href="https://jobs.django-news.com">{% translate "Django News Jobs" %}</a>

                    <a href="https://django-news.com">{% translate "Django News Newsletter" %}</a>

                </div>

            </div>
        </div>

        <!-- Start of webring -->
        <div class="webring pre-pre-footer">
            <div class="container">
                <div class="row tw:m-8">
                    <div class="col-sm-4 col-lg-4"></div>
                    <div class="col-sm-4 col-lg-4">
                        <webring-css site="https://djangopackages.org"></webring-css>
                        <script src="https://djangowebring.com/static/webring.js"></script>
                    </div>
                    <div class="col-sm-4 col-lg-4"></div>
                </div>
            </div>
        </div>

        <!-- Start of footer -->
        <div class="footer">
            <div class="container">
                <div class="row">
                    <div class="col-12">
                        &copy; 2010-{% now "Y" %} <a href="https://github.com/djangopackages/djangopackages/graphs/contributors">Contributors</a>,

                        {# Please leave Daniel and Audrey's attribution here #}
                        2010-2021 funded by <a href="https://www.feldroy.com/tech">Two Scoops Press</a>,
                        an imprint of <a href="https://www.feldroy.com/">Feldroy</a>.<br/>
                        Originally developed by <a href="http://daniel.feldroy.com">Daniel Roy Greenfeld</a>
                        &amp; <a href="https://audrey.feldroy.com/">Audrey Roy Greenfeld</a>.
                        {# end of Daniel and Audrey's attribution #}

                        <br/>
                        Currently maintained by
                        <a href="https://twitter.com/webology">Jeff Triplett</a>
                        and development sponsored by
                        <a href="https://www.revsys.com/">REVSYS</a>.
                        <br/>

                        Hosted on DigitalOcean.
                        <a href="https://www.digitalocean.com/?refcode=d66a400de67f&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge">Please use our free $200 credit referral link to get you started.</a>
                    </div>
                </div>
            </div>
        </div>
        <!-- End of footer -->

        {% include "includes/_gtag-js.html" %}

        {% block javascript %}
            <script src="{{ STATIC_URL }}bower_components/jquery/jquery.min.js" type="text/javascript"></script>
            <script src="{{ STATIC_URL }}components/audreyr-rotatingnav/dist/jquery.rotatingnav.min.js"></script>
            <script src="{{ STATIC_URL }}components/audreyr-topbar/dist/jquery.topbar.min.js"></script>
            <script src="{{ STATIC_URL }}js/jquery.tablesorter.min.js" type="text/javascript"></script>
            <script src="{{ STATIC_URL }}js/jquery.tools.min.js" type="text/javascript"></script>
            <script src="{{ STATIC_URL }}js/site.js" type="text/javascript"></script>
            <script type="module" src="{{ STATIC_URL }}js/svg-sparkline.js"></script>
        {% endblock javascript %}

        <script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
        <noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt="" referrerpolicy="no-referrer-when-downgrade" /></noscript>

        {% block extra_body %}{% endblock %}

        <!-- Start of Bootstrap initialization -->
        <script src="{% static 'bower_components/bootstrap/dist/js/bootstrap.min.js' %}" defer></script>
        <script type="text/javascript">
            $(function() {
                // Enable tooltips sidewide
                $('[data-toggle="tooltip"]').tooltip({
                    container: 'body',
                });
            });
        </script>
        <!-- End of Bootstrap initialization -->

        <script type="text/javascript" defer src="{% url 'wafflejs' %}"></script>

        {{ PIWIK_CODE|safe }}
    </body>
</html>
